package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.ItemUser;
import cn.wolfcode.trip.base.mapper.ItemUserMapper;
import cn.wolfcode.trip.base.service.IItemUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemUserServiceImpl implements IItemUserService {

    @Autowired
    private ItemUserMapper itemUserMapper;

    @Override
    public void deleteByPrimaryKey(Long id) {
        itemUserMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void insert(ItemUser itemUser) {
        itemUserMapper.insert(itemUser);
    }

    @Override
    public ItemUser selectByPrimaryKey(Long id) {
        return itemUserMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ItemUser> selectAll() {
        return itemUserMapper.selectAll();
    }

    @Override
    public List<ItemUser> selectByUserId(Long userId) {
        return itemUserMapper.selectByUserId(userId);
    }

    @Override
    public void updateShopCarInfo(ItemUser itemUser) {
        itemUserMapper.updateByPrimaryKey(itemUser);
    }

    @Override
    public ItemUser getConfirmInfo(Long shopCarId) {
        return itemUserMapper.selectConfirmInfo(shopCarId);
    }
}
